package com.behome.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.behome.common.core.domain.entity.SysRegion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysRegionMapper extends BaseMapper<SysRegion> {
    List<SysRegion> selectRegionList(SysRegion sysRegion);

    SysRegion checkRegionNameUnique(@Param("name") String name, @Param("parentRegionId") String parentRegionId);

    List<SysRegion> selectChildrenRegionById(String regionId);

    void updateRegionChildren(@Param("regionList") List<SysRegion> regionList);

    int hasChildByRegionId(String regionId);

    int checkRegionExistUser(@Param("regionId") String regionId, @Param("username") String username);

    List<String> selectRegionListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
}